/* 基本样式 */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* 添加按钮样式 */
.add-button-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.add-btn {
    padding: 12px 24px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* 待办事项列表样式 */
#todo-list {
    list-style-type: none;
    padding: 0;
}

.todo-item {
    background-color: white;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    transition: background-color 0.3s;
}

.todo-item:hover {
    background-color: #f9f9f9;
}

.todo-item.completed {
    background-color: #f1f1f1;
    text-decoration: line-through;
    color: #888;
}

.todo-checkbox {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    margin-top: 3px;
}

.todo-content {
    flex: 1;
}

.todo-text {
    font-size: 16px;
    margin-bottom: 5px;
}

.todo-details {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.todo-created-at {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    font-style: italic;
}

.todo-due-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.todo-due-date.overdue {
    color: #e74c3c;
    font-weight: bold;
}

.todo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.todo-actions {
    display: flex;
    gap: 5px;
}

.delete-btn, .edit-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.edit-btn {
    background-color: #3498db;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.edit-btn:hover {
    background-color: #2980b9;
}

/* 优先级标记样式 */
.priority-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 3px;
}

.priority-high {
    background-color: #e74c3c;
}

.priority-medium {
    background-color: #f39c12;
}

.priority-low {
    background-color: #3498db;
}

.priority-none {
    background-color: #bdc3c7;
}

/* 排序控件样式 */
.sort-controls {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 8px 12px;
    background-color: #ecf0f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sort-btn:hover {
    background-color: #dfe6e9;
}

.sort-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 操作控件样式 */
.action-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

.danger-btn {
    padding: 8px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.danger-btn:hover {
    background-color: #c0392b;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: #3498db;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.tag-delete {
    margin-left: 5px;
    cursor: pointer;
}

.tag-filter-container {
    margin-bottom: 15px;
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag-filter {
    padding: 5px 10px;
    background-color: #ecf0f1;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.tag-filter:hover {
    background-color: #dfe6e9;
}

.tag-filter.active {
    background-color: #3498db;
    color: white;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.tags-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tags-input-container input {
    flex: 1;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.save-btn {
    padding: 8px 15px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.save-btn:hover {
    background-color: #27ae60;
}

.cancel-btn {
    padding: 8px 15px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.cancel-btn:hover {
    background-color: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .todo-input {
        flex-direction: column;
    }
    
    .priority-container {
        margin-bottom: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}